cmake_minimum_required(VERSION 2.8)

add_definitions(-g -Wall -Werror)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_1by1_1.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_1by2.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_1by3.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_1by4.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_2by1.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_2by2.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_2by3.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_2by4.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_3by1.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_3by2.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_3by3.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_3by4.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_4by1.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_4by2.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_4by3.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_4by4.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/B_4by4.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/C_4by4.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_100by100.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/matrices/A_1000by1000.max ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)

file(GLOB SRCS  MatrixUtils.cpp
		Matrix.h
		MatrixMath.cpp
		MatlabPrinter.cpp
		MatlabPrinter.h)

add_library(Matrix-classes ${SRCS})
add_executable(Matrix-main maintest.cpp test.h)
add_executable(Matrix-calc calculator.cpp test.h)

target_link_libraries(Matrix-main Matrix-classes)
target_link_libraries(Matrix-calc Matrix-classes)

enable_testing()
add_test(test1 Matrix-main)
